﻿using System;
using System.Reflection;
using System.Windows.Forms;
using ResourceManager=LetsDoIt.Localization.ResourceManager;

namespace LetsDoIt
{
	static class Program
	{
		// Create a logger for use in this class
		public static readonly log4net.ILog Log =
					 log4net.LogManager.GetLogger(typeof(Program));

		/// <summary>
		/// The main entry point for the application.
		/// </summary>
		[MTAThread]
		static void Main()
		{
			//Load Config.xml to setup log4net
			string path = System.IO.Path.GetDirectoryName(
				System.Reflection.Assembly.GetExecutingAssembly()
			   .GetModules()[0].FullyQualifiedName)
			   + "\\Config.xml";
			if (System.IO.File.Exists(path))
			{
				log4net.Config.DOMConfigurator.Configure(new System.IO.FileInfo(path));
			}

			//Log.Debug("Application started");

            try
            {
                ResourceManager.Instance.CallingAssembly = Assembly.GetExecutingAssembly();
				Application.Run(new MainForm());
            }
            catch (Exception ex)
            {
                Log.Error(ex.ToString());
                throw;
            }
		}
	}
}